// Abstract class
public class D12 {
   

    public static void main(String[] args) {
        // Why is this, Abs class can not new a instance
        // AbsClass abs = new AbsClass("Haha", "Addr of shit", 10);

        SonWithAbsFather son = new SonWithAbsFather("Son", "MixLang", 0, 0);
        System.out.println(son.toString());
        System.out.println(son.computePay());
        son.IHaveAbsMethod();
    }
}

abstract class AbsClass {
    private String name;
    private String address;
    private int number;

    public AbsClass(String name, String address, int number) {
        System.out.println("Ctor Init");
        this.name = name;
        this.address = address;
        this.number = number;
    }

    public double computePay() {
        System.out.println("Inside Employee computePay");
        return 0.0;
    }

    public void mailCheck() {
        System.out.println("Mailing a check to " + this.name + " " + this.address);
    }

    public abstract void IHaveAbsMethod();

    @Override
    public String toString() {
        return name + " " + address + " " + number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }
}

class SonWithAbsFather extends AbsClass {
    private double salary;
    public SonWithAbsFather(String name, String address, int number, double salary) {
        super(name, address, number);
        setSalary(salary);
    }


    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }   

    public double computePay() {
        System.out.println("Computing salary pay for " + getName());
        return getSalary();
    }

    public void IHaveAbsMethod() {
        System.out.println("Son impl Father abs method");
    }
}